Scouts Needle Compass – Auto Tracking is a lightweight, fully offline-capable, browser-based solar compass application.
The application determines direction using:
The compass needle is manually rotated to match a real-world shadow. The system then calculates the relative directional target.
This version (Vp1) is optimized for offline hosting and minimal file size.
This application uses a simplified astronomical solar position model derived from standard spherical trigonometry.
It is NOAA-style in structure but is NOT the full NOAA Solar Position Algorithm (SPA).
The model includes:
Azimuth is resolved using:
azimuth = atan2(y, x)
This ensures correct 0–360° directional output across all quadrants.
The model does NOT include:
Accuracy range is typically ±0.5° to ±1.5° (depending on latitude and season).
For shadow-based field navigation, this accuracy is more than sufficient. In practical use, GPS precision usually introduces more positional error than the solar math itself.
Step 1 – GPS Acquisition
The browser retrieves latitude and longitude using the Geolocation API.
Step 2 – Solar Position Calculation
The app computes solar azimuth based on current UTC time and location.
Step 3 – Shadow Direction
shadowAzimuth = (sunAzimuth + 180) % 360
Step 4 – User Alignment
The user rotates the SVG needle to match the real-world shadow.
Step 5 – Target Calculation
target = (shadowAzimuth - currentNeedleAzimuth + 360) % 360
Step 6 – Display
The target is shown as one of the 16 compass directions. Internally, calculations remain degree-based for precision.
Recommended: Mobile device with touch screen.
Single standalone file: scouts_needle_compass_offline_16_direction_Vp1.html
Contains:
This project is licensed under the MIT License.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files, to deal in the Software without restriction, including without limitation the rights to:
Subject to inclusion of the copyright notice.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
This application is intended for educational, experimental, scouting, and solar-navigation purposes only.
The author assumes no liability for misuse, navigation errors, or damages arising from use of this software.